<template>
	<view>
		<view v-if="data != '' ">
			<view class="listFansBox">
				<view @tap="GoUsers(v)" v-for="(v,i) in data" :key="i" class="listFans">
					<image class="userImg" :src="v.resultData.avatarImg" mode=""></image>
					<view class="userTxt">
						<p class="p1 one">
							{{v.resultData.fromMemberName}}
						</p>
						<p class="p2 one">
							{{v.content}}
						</p>
					</view>
					<!-- <view class="pinkLabel">
						 <image class="addIcons" src="../../static/image/icon_duihao@2x.png" mode=""></image>
						关注
					</view> -->
				</view>
			</view>
		</view>
		<view v-if="data == '' " class=" dataNone">
			<image src="../../static/image/dongtai@2x.png" mode=""></image>
			<p>暂无消息 ~ </p>
		</view>
	</view>
</template>

<script>
	import {
		messageList
	} from '../../api/api.js'
	export default {
		data() {
			return {
				pageNumber: 1,
				pageSize: 10,
				stops: 0,
				data: []
			}
		},
		onLoad() {
			this.init()
		},
		onReachBottom() {
			if (this.stops == 0) {
				this.init()
			}
		},
		methods: {
			GoUsers(v) {
				this.$navigateTo('../DynamicDetails/DynamicDetails?id=' + v.resultData.dynamicId)
			},
			async init() {
				let parameret = {
					pageable: {
						pageNumber: this.pageNumber,
						pageSize: this.pageSize
					},
					type: 'COMMENT_PRAISE'
				}
				let data = await messageList(parameret)
				data = data.data
				if (data.length != this.pageSize) {
					this.stops = 1
				}
				this.data = [...this.data, ...data]
				this.pageNumber++
			},
		}
	}
</script>

<style lang="less" scoped>
	@import './index.less';
</style>
